﻿@model FlyingClub.Models.Flight

@{
    ViewBag.Title = "Ajouter nouveau vol";
}

<h2>Create</h2>
<script src="../../Scripts/jquery-ui-1.8.11.min.js" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Vol</legend>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.DepartureDate, "Date de départ")
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.DepartureDate, new { @class = "datefield" })
            @Html.ValidationMessageFor(model => model.DepartureDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DepartureAirfield, "Aéroport de départ")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DepartureAirfield)
            @Html.ValidationMessageFor(model => model.DepartureAirfield)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ArrivalDate, "Date d'arrivée")
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.ArrivalDate, new { @class = "datefield" })
            @Html.ValidationMessageFor(model => model.ArrivalDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ArrivalAirfield, "Aéroport d'arrivée")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ArrivalAirfield)
            @Html.ValidationMessageFor(model => model.ArrivalAirfield)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PilotID, "Pilote")
        </div>
        <div class="editor-field">
            @Html.DropDownList("PilotID", String.Empty)
            @Html.ValidationMessageFor(model => model.PilotID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.StudentID, "Etudiant")
        </div>
        <div class="editor-field">
            @Html.DropDownList("StudentID", String.Empty)
            @Html.ValidationMessageFor(model => model.StudentID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.TransactionID, "Transaction")
        </div>
        <div class="editor-field">
            @Html.DropDownList("TransactionID", String.Empty)
            @Html.ValidationMessageFor(model => model.TransactionID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PlaneID, "Avion")
        </div>
        <div class="editor-field">
            @Html.DropDownList("PlaneID", String.Empty)
            @Html.ValidationMessageFor(model => model.PlaneID)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Retour à la liste", "Index")
</div>
